/**
 * @Auther: ChenforCode
 * @Date: 2018/9/11 12:07
 * @Description:
 */
package cn.chenforcode.entity;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;

@Entity
public class Student {
    private String sno;
    private String spwd;
    private String sname;
    private String gender;
    private String college;
    private String sclass;
    private long balance;
    private long have;
    private long total;

    @Id
    @Column(name = "SNO")
    public String getSno() {
        return sno;
    }

    public void setSno(String sno) {
        this.sno = sno;
    }

    @Basic
    @Column(name = "SPWD")
    public String getSpwd() {
        return spwd;
    }

    public void setSpwd(String spwd) {
        this.spwd = spwd;
    }

    @Basic
    @Column(name = "SNAME")
    public String getSname() {
        return sname;
    }

    public void setSname(String sname) {
        this.sname = sname;
    }

    @Basic
    @Column(name = "GENDER")
    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    @Basic
    @Column(name = "COLLEGE")
    public String getCollege() {
        return college;
    }

    public void setCollege(String college) {
        this.college = college;
    }

    @Basic
    @Column(name = "SCLASS")
    public String getSclass() {
        return sclass;
    }

    public void setSclass(String sclass) {
        this.sclass = sclass;
    }

    @Basic
    @Column(name = "BALANCE")
    public long getBalance() {
        return balance;
    }

    public void setBalance(long balance) {
        this.balance = balance;
    }

    @Basic
    @Column(name = "HAVE")
    public long getHave() {
        return have;
    }

    public void setHave(long have) {
        this.have = have;
    }

    @Basic
    @Column(name = "TOTAL")
    public long getTotal() {
        return total;
    }

    public void setTotal(long total) {
        this.total = total;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Student student = (Student) o;

        if (balance != student.balance) return false;
        if (have != student.have) return false;
        if (total != student.total) return false;
        if (sno != null ? !sno.equals(student.sno) : student.sno != null) return false;
        if (spwd != null ? !spwd.equals(student.spwd) : student.spwd != null) return false;
        if (sname != null ? !sname.equals(student.sname) : student.sname != null) return false;
        if (gender != null ? !gender.equals(student.gender) : student.gender != null) return false;
        if (college != null ? !college.equals(student.college) : student.college != null) return false;
        if (sclass != null ? !sclass.equals(student.sclass) : student.sclass != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = sno != null ? sno.hashCode() : 0;
        result = 31 * result + (spwd != null ? spwd.hashCode() : 0);
        result = 31 * result + (sname != null ? sname.hashCode() : 0);
        result = 31 * result + (gender != null ? gender.hashCode() : 0);
        result = 31 * result + (college != null ? college.hashCode() : 0);
        result = 31 * result + (sclass != null ? sclass.hashCode() : 0);
        result = 31 * result + (int) (balance ^ (balance >>> 32));
        result = 31 * result + (int) (have ^ (have >>> 32));
        result = 31 * result + (int) (total ^ (total >>> 32));
        return result;
    }

    @Override
    public String toString() {
        return "Student{" +
                "sno='" + sno + '\'' +
                ", spwd='" + spwd + '\'' +
                ", sname='" + sname + '\'' +
                ", gender='" + gender + '\'' +
                ", college='" + college + '\'' +
                ", sclass='" + sclass + '\'' +
                ", balance=" + balance +
                ", have=" + have +
                ", total=" + total +
                '}';
    }
}
